package day0725;

import java.util.Arrays;

public class Test6 {
    public static void main(String[] args) {
        int[]  a = { (int)(Math.random()*10),  (int)(Math.random()*10), (int)(Math.random()*10)};
        getMax(a);//方法的調用
    }

    static void  getMax(int[]  b){//用for循环找出数组的最大元素，并打印
        System.out.println(Arrays.toString(b));
        int t=-100;
        for (int i = 0; i < 3; i++) {//参数传递
            if(t<b[i]){
                t=b[i];
            }
        }
        System.out.println(t);
    }













}
